﻿<%@ Page Title="ScrumPeak.com" Language="C#" MasterPageFile="~/Views/Shared/Site.Master"
  AutoEventWireup="true" Inherits="System.Web.Mvc.ViewPage<SelectStoriesModel>" %>

<%@ Import Namespace="Peak.Web.Controllers.HtmlExtentions" %>
<%@ Import Namespace="Peak.Resources" %>
<%@ Import Namespace="Peak.Web.Controllers" %>
<%@ Import Namespace="Peak.Core" %>
<%@ Import Namespace="Peak.Web.Controllers.Models" %>
<asp:Content ContentPlaceHolderID="center" runat="server">

  <div class="page-content">
    <div class="page-title">
      <%= PageTitles.SelectStories %>
    </div> 
    <form method="post" action="<%= ResolveUrl(Model.ReturnUrl) %>">
    <%= Html.HiddenFor(f=>f.SprintId) %>
    <table class="table">
      <thead>
        <tr>
        <% if (Model.MultipleSelection)
           {%>
          <th class="autoWidthColumn">   
          </th>
        <% }%>
          <th>
            <%= Columns.Name %>
          </th>
          <th width="100px">
            <%= Columns.Status %>
          </th>
          <th width="10px">
            <%= Columns.Priority %>
          </th>
          <th width="10px">
            <%= Columns.StoryPoints %>
          </th>
        </tr>
      </thead>
      <tbody>
        <% foreach (Story story in Model.Stories)
           { %>
        <tr>
        <% if (Model.MultipleSelection)
           {%>
          <td align="center">
            <input type="checkbox" name="storyIds" value="<%= story.Id %>" />
          </td>
        <% }%>
          <td>
        <% if (Model.MultipleSelection)
           {%>
            <%=story.Name%>    
        <% } 
           else
           {%>             
           
            <a href="<%= ResolveUrl(Model.ReturnUrl)+"storyIds="+story.CurrentSprintStory.Id %>"><%= story.Name %></a>
        <% }%>
          </td>
          <td width="100px">
            <%= story.Status %>
          </td>
          <td width="10px">
            <%= story.Priority %>
          </td>
          <td width="10px">
            <%= story.StoryPoints %>
          </td>
        </tr>
        <% } %>
        <% if (ViewData.Model.Stories.Count == 0)
           {%>
        <tr>
          <td colspan="10">
            <%= Messages.NoResults%>
          </td>
        </tr>
        <% } %>
      </tbody>
    </table>    
              
    <%= Html.PeakSubmitButton(Buttons.Select) %>
    <%= Html.CancelButton() %>
    </form>  
  </div>
</asp:Content>
